<form action="/${orgi}/design/query/newcol/${report.id!''}/${reportModel.id!''}.html" data-toggle="ajax-form" data-target="#design_table" method="post" id="mainForm">
<input type="hidden" id="rowindex" name="rowindex" value="-1">
<div class="artCon">
	<div class="middleArt">
		<div class="artMain">
			<div class="mainTop row-fluid" style="padding-bottom:0px;">
				<div class="span2"><h3>列标题：</h3></div>
				<div class="span4"><input type="text" class="required" value="合计" name="name"></div>
				<div class="span2" style="text-align:right;"><h3 style="line-height:20px;">列类型：</h3></div>
				<div class="span3" style="display:inline-flex;">
					<input type="radio" value="sum" name="coltype" id="sumcol" onclick="$('#exp').hide();$('#expressmeasure').val('ALL')" checked="checked"><label for="sumcol">汇总列</label>
					<input type="radio" value="def" name="coltype" id="defcol" onclick="$('#exp').show();$('#expressmeasure').val('')"><label for="defcol">普通列</label>
				</div>
			</div>
			<div class="mainTop row-fluid" style="padding-bottom:0px;">
				<div class="span2"><h3>格式化：</h3></div>
				<div class="span8">
					<input type="text" value="###,###.##" name="formatstr">
				</div>
			</div>
			<div class="mainTop row-fluid" style="padding-bottom:0px;display:none;" id="exp">
				<div class="span2"><h3>计算公式：</h3></div>
				<div class="span8">
					<textarea name="express" class="required "  style="width:410px;height:40px;" id="expressmeasure" onclick="curCurPos = getStartPos(this)">ALL</textarea>
					<div class="span12" style="margin-left:0px;padding-left:0px;">
						<div class="function" style="border:0px;height:15px;padding:0px;">
							<span style="border:0px;font-size:20px;margin-right:0px;">
								<a href="javascript:void(0)" title="保存" class="tbtn" id="save" style="text-decoration: blink;width:25px;line-height:15px;height:20px;" onclick="BtnAction.operators('#expressmeasure' , ' + ');">
									+
								</a>
							</span>
							<span style="border:0px;font-size:20px;margin-right:0px;">
								<a href="javascript:void(0)" title="保存" class="tbtn" id="save" style="text-decoration: blink;width:25px;line-height:15px;height:20px;"onclick="BtnAction.operators('#expressmeasure' , ' - ');">
									-
								</a>
							</span>
							<span style="border:0px;font-size:15px;margin-right:0px;">
								<a href="javascript:void(0)" title="保存" class="tbtn" id="save" style="text-decoration: blink;width:25px;line-height:20px;height:20px;"onclick="BtnAction.operators('#expressmeasure' , ' * ');">
									*
								</a>
							</span>
							<span style="border:0px;font-size:15px;margin-right:0px;">
								<a href="javascript:void(0)" title="保存" class="tbtn" id="save" style="text-decoration: blink;width:25px;line-height:15px;height:20px;"onclick="BtnAction.operators('#expressmeasure' , ' / ');">
									/
								</a>
							</span>
							<span style="border:0px;font-size:15px;margin-right:0px;">
								<a href="javascript:void(0)" title="保存" class="tbtn" id="save" style="text-decoration: blink;width:25px;line-height:15px;height:20px;"onclick="BtnAction.operators('#expressmeasure' , '(');">
									( 
								</a>
							</span>
							<span style="border:0px;font-size:15px;margin-right:0px;">
								<a href="javascript:void(0)" title="保存" class="tbtn" id="save" style="text-decoration: blink;width:25px;line-height:15px;height:20px;"onclick="BtnAction.operators('#expressmeasure' , ')');">
									)
								</a>
							</span>
							<span style="border:0px;font-size:15px;margin-right:0px;">
								<a href="javascript:void(0)" title="保存" class="tbtn" id="save" style="text-decoration: blink;width:25px;line-height:15px;height:20px;"onclick="BtnAction.operators('#expressmeasure' , '(  )');">
									()
								</a>
							</span>
						</div>
					</div>
					<i style="color:#4095d4;">* 请从数据表格中点选需要加入公式计算的指标</i>
					
				</div>
			</div>
			<div class="mainTop row-fluid" style="padding-bottom:0px;">
				<div class="span2"><h3>分组聚合：</h3></div>
				<div class="span1">
					<select onchange="if($(this).val()=='true'){$('#func').show();}else{$('#func').hide();}" name="group">
						<option selected="selected" value="false">否</option>
						<option value="true">是</option>
					</select>
				</div>


				<div style="display: none;padding:0 5px 0 5px;" id="func" class="span9">
					<div id="format" class="row-fluid">
						<div class="span2"><h3>聚合方式：</h3></div>
						<div class="span3">
							<select name="grouptype" class="span12">
								<option value="sum">求和</option>
								<option value="avg">平均数</option>
								<option value="max">最大值</option>
								<option value="min">最小值</option> 
							</select>
						</div>
						<div class="span2"><h3>聚合维度：</h3></div>
						<div class="span3">
							<select name="groupdim" class="span12 required">
								<#if coltitle??>
								<#list coltitle as dim>
								<#if dim_index lt coltitle?size-1>
								<option value="${dim}" <#if data.groupdim ?? && data.groupdim == dim>selected="selected"</#if>>${dim}</option>
								</#if>
								</#list>
								</#if>
							</select>
						</div>
					</div>
				</div>
			</div>

			<div class="mainTop row-fluid" style="padding-bottom:0px;">
				<div class="span2"><h3>自定义位置：</h3></div>
				<div class="span1">
					<select onchange="if($(this).val()=='true'){$('#pos').show();}else{$('#pos').hide();}" name="posdef">
						<option selected="selected" value="false">否</option>
						<option value="true">是</option>
					</select>
				</div>


				<div style="display: none;padding:0 5px 0 5px;" id="pos" class="span9">
					<div id="format" class="row-fluid">
						<div class="span2"><h3>层级：</h3></div>
						<div class="span3">
							<select name="colpos" onchange="BtnAction.colpos($(this).val() , '#colpos')" class="span12 required">
								<#if rowtitle??>
								<#list rowtitle as dim>
								<option value="${dim}" <#if data.posdef?? && data.posdef == true && data.colpos?? && data.colpos == dim>selected="selected"</#if>>${dim}</option>
								</#list>
								</#if>
							</select>
						</div>
						<div class="span2"><h3>位置：</h3></div>
						<div class="span3" id="colpos">
							<#include "colpos.html"/>							
						</div>
					</div>	
					<div id="format" class="row-fluid">
						<div class="span2"><h3>类型：</h3></div>
						<div class="span3">
							<label><input name="colpostype" value="cur" type="radio" checked="checked">当前级</label>
							<label><input name="colpostype" value="next" type="radio">下一级</label>
						</div>
						<div class="span2"><h3>分组：</h3></div>
						<div class="span3">
							<label><input name="colgroup" value="1" type="radio" checked="checked">分组</label>
							<label><input name="colgroup" value="0" type="radio">所有列</label>
						</div>
					</div>
					
					
				</div>
			</div>
		</div>
		<div class="bottomBg">
			<div class="btnWrap">
				<input type="submit" class="subButtonStyle" value="确认"/>
				<input type="button" onclick="closeR3ArtDialog()" class="cancelButtonStyle" value="取消"/>
			</div>
		</div>
	</div>
</div>
</form>